﻿using System.ComponentModel;
using System.Xml;
using System.Xml.Serialization;
using com.woodsoft.core.Files;
using System;

namespace com.woodsoft.core {
  public class UIElement : XmlElement {
    public UIElement ( string pre , string local , string ns , UIDocument doc )
      : base( pre , local , ns , doc ) {
    }

    /// <summary>
    /// This should be used for value-based Elements only
    /// </summary>
    /// <param name="name"></param>
    /// <param name="value"></param>
    public void Validate ( string name , string value ) {
      if( this.GetElement( name ) == null )
        this.AddElement( name , value );
      else
        this.GetElement( name ).InnerText = value;

    }

  }
}
